3.1.23 \(\int (a+a \sec (c+d x))^3 \, dx\) [23]

Optimal. Leaf size=66 \[ a^3 x+\frac {7 a^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a^3 \tan (c+d x)}{2 d}+\frac {\left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{2 d} \]

[Out]

a^3*x+7/2*a^3*arctanh(sin(d*x+c))/d+5/2*a^3*tan(d*x+c)/d+1/2*(a^3+a^3*sec(d*x+c))*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.417, Rules used = {3860, 3999, 3852, 8, 3855} \begin {gather*} \frac {5 a^3 \tan (c+d x)}{2 d}+\frac {7 a^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}+a^3 x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + a*Sec[c + d*x])^3,x]

[Out]

a^3*x + (7*a^3*ArcTanh[Sin[c + d*x]])/(2*d) + (5*a^3*Tan[c + d*x])/(2*d) + ((a^3 + a^3*Sec[c + d*x])*Tan[c + d
*x])/(2*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3860

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_))^(n_), x_Symbol] :> Simp[(-b^2)*Cot[c + d*x]*((a + b*Csc[c + d*x])^(
n - 2)/(d*(n - 1))), x] + Dist[a/(n - 1), Int[(a + b*Csc[c + d*x])^(n - 2)*(a*(n - 1) + b*(3*n - 4)*Csc[c + d*
x]), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0] && GtQ[n, 1] && IntegerQ[2*n]

Rule 3999

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[a*c*x, x]
 + (Dist[b*d, Int[Csc[e + f*x]^2, x], x] + Dist[b*c + a*d, Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e,
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rubi steps

\begin {align*} \int (a+a \sec (c+d x))^3 \, dx &=\frac {\left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{2 d}+\frac {1}{2} a \int (a+a \sec (c+d x)) (2 a+5 a \sec (c+d x)) \, dx\\ &=a^3 x+\frac {\left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{2 d}+\frac {1}{2} \left (5 a^3\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (7 a^3\right ) \int \sec (c+d x) \, dx\\ &=a^3 x+\frac {7 a^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {\left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{2 d}-\frac {\left (5 a^3\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{2 d}\\ &=a^3 x+\frac {7 a^3 \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a^3 \tan (c+d x)}{2 d}+\frac {\left (a^3+a^3 \sec (c+d x)\right ) \tan (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(235\) vs. \(2(66)=132\).
time = 0.96, size = 235, normalized size = 3.56 \begin {gather*} \frac {1}{32} a^3 (1+\cos (c+d x))^3 \sec ^6\left (\frac {1}{2} (c+d x)\right ) \left (4 x-\frac {14 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {14 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {1}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}-\frac {1}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 \sin (d x)}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sec[c + d*x])^3,x]

[Out]

(a^3*(1 + Cos[c + d*x])^3*Sec[(c + d*x)/2]^6*(4*x - (14*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]])/d + (14*Log[
Cos[(c + d*x)/2] + Sin[(c + d*x)/2]])/d + 1/(d*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])^2) - 1/(d*(Cos[(c + d*x)/
2] + Sin[(c + d*x)/2])^2) + (12*Sin[d*x])/(d*(Cos[c/2] - Sin[c/2])*(Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] - S
in[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))))/32

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 80, normalized size = 1.21

method result size
derivativedivides \(\frac {a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} \tan \left (d x +c \right )+3 a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} \left (d x +c \right )}{d}\) \(80\)
default \(\frac {a^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 a^{3} \tan \left (d x +c \right )+3 a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} \left (d x +c \right )}{d}\) \(80\)
risch \(a^{3} x -\frac {i a^{3} \left ({\mathrm e}^{3 i \left (d x +c \right )}-6 \,{\mathrm e}^{2 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}-6\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}\) \(104\)
norman \(\frac {a^{3} x +a^{3} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {7 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {5 a^{3} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-2 a^{3} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {7 a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {7 a^{3} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(133\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(d*x+c))^3,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^3*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+3*a^3*tan(d*x+c)+3*a^3*ln(sec(d*x+c)+tan(d*
x+c))+a^3*(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 91, normalized size = 1.38 \begin {gather*} a^{3} x - \frac {a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{4 \, d} + \frac {3 \, a^{3} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} + \frac {3 \, a^{3} \tan \left (d x + c\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^3,x, algorithm="maxima")

[Out]

a^3*x - 1/4*a^3*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(sin(d*x + c) - 1))/d + 3*a^
3*log(sec(d*x + c) + tan(d*x + c))/d + 3*a^3*tan(d*x + c)/d

________________________________________________________________________________________

Fricas [A]
time = 4.07, size = 98, normalized size = 1.48 \begin {gather*} \frac {4 \, a^{3} d x \cos \left (d x + c\right )^{2} + 7 \, a^{3} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - 7 \, a^{3} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (6 \, a^{3} \cos \left (d x + c\right ) + a^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^3,x, algorithm="fricas")

[Out]

1/4*(4*a^3*d*x*cos(d*x + c)^2 + 7*a^3*cos(d*x + c)^2*log(sin(d*x + c) + 1) - 7*a^3*cos(d*x + c)^2*log(-sin(d*x
 + c) + 1) + 2*(6*a^3*cos(d*x + c) + a^3)*sin(d*x + c))/(d*cos(d*x + c)^2)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int 1\, dx + \int 3 \sec {\left (c + d x \right )}\, dx + \int 3 \sec ^{2}{\left (c + d x \right )}\, dx + \int \sec ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))**3,x)

[Out]

a**3*(Integral(1, x) + Integral(3*sec(c + d*x), x) + Integral(3*sec(c + d*x)**2, x) + Integral(sec(c + d*x)**3
, x))

________________________________________________________________________________________

Giac [A]
time = 0.47, size = 100, normalized size = 1.52 \begin {gather*} \frac {2 \, {\left (d x + c\right )} a^{3} + 7 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 7 \, a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (5 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 7 \, a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(d*x+c))^3,x, algorithm="giac")

[Out]

1/2*(2*(d*x + c)*a^3 + 7*a^3*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - 7*a^3*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2
*(5*a^3*tan(1/2*d*x + 1/2*c)^3 - 7*a^3*tan(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d

________________________________________________________________________________________

Mupad [B]
time = 0.74, size = 88, normalized size = 1.33 \begin {gather*} a^3\,x+\frac {7\,a^3\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {5\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-7\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(c + d*x))^3,x)

[Out]

a^3*x + (7*a^3*atanh(tan(c/2 + (d*x)/2)))/d - (5*a^3*tan(c/2 + (d*x)/2)^3 - 7*a^3*tan(c/2 + (d*x)/2))/(d*(tan(
c/2 + (d*x)/2)^4 - 2*tan(c/2 + (d*x)/2)^2 + 1))

________________________________________________________________________________________